const axios = require('axios');
import { baseUrl } from "./config"
axios.interceptors.request.use(function (config) {
  config.headers['X-Auth-Token'] = '6beabe7e25d1417194cd040a089cbbc8'
  return config;
}, function (error) {
  return Promise.reject(error);
});

axios.interceptors.response.use(function (response) {
  var { data } = response
  return data;
}, function (error) {
  return Promise.reject(error);
});

axios.get('http://eqg-api.malltest.liqiang365.com/api/v1/xcx/qrCode').then(res => {
  console.log(res)
})


export function request({ url, method = 'get', data = {}, params = {} }) {

  return axios.request({
    url: url,
    baseURL: baseUrl,
    method,
    data,
    params
  })


}

